﻿@model Views_Goods
@{
    Layout = "~/Views/Shared/_ContentLayout.cshtml";
}
@{
    var viewModel = Model ?? new Views_Goods();
    ADZ_MasterEntities dbcontext = new ADZ_MasterEntities();
    Dictionary<string, string> dc = new Dictionary<string, string>();
}



<form id="S_Form" action="@Url.Action("toWithdrawDown", "product")" method="post" class="definewidth m20" enctype="multipart/form-data">
    <table class="table table-bordered table-hover definewidth m10">
        <tr>
            <td colspan="2" style="width:50%">
                <h5>
                    @ViewBag.Title
                </h5>
                <input type="hidden" value="@viewModel.goods_id" name="id" />
            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">料号<em>*</em></td>
            <td>@viewModel.MPN</td>
        </tr>
        <tr>
            <td class="tableleft"><font color="red">*</font>下架原因</td>
            <td colspan="3"><textarea name="reason" style="width:80%;" maxlength="2500" cols="4"></textarea></td>
        </tr>
        <tr>
            <td class="tableleft"></td>
            <td colspan="3">
                <p><span id="spMsg"></span></p>
                <button type="submit" class="btn btn-primary">保存</button> &nbsp;&nbsp;
                <button type="button" class="btn btn-success" name="backid" id="backid">返回</button>
            </td>

        </tr>
    </table>
    <script>
        BUI.use('bui/overlay', function (overlay) {
            $(function () {
                var rules = {
                    'reason': { required: true }

                };
                var messages = {
                    'reason': { required: '下架原因必选' },
                };

                var validator = $('form').validate({
                    errorLabelContainer: $("#errorContainer"),
                    errorElement: "span",
                    rules: rules,
                    messages: messages,
                    submitHandler: function (form) {
                        $(form).ajaxSubmit(function (result) {

                            ShowActionResult(result, function () { self.location = document.referrer; });//self.location = document.referrer;
                        });
                    }
                });

            });
        });
    </script>
</form>

